From 74cec71095c1147cb257eb4fecb9c006830161d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sat, 10 Nov 2007 23:19:11 +0000 Subject: [PATCH] Do not accept BABL_FISH_REFERENCE as a valid result when fishing for existing fishes. * babl/babl-fish.c: (fishing_result_examine), (babl_fish): svn path=/trunk/; revision=245 --- ChangeLog | 7 +++++++ babl/babl-fish.c | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3e5c16..7f55eb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-11-10 Øyvind Kolås + + Do not accept BABL_FISH_REFERENCE as a valid result when fishing for + existing fishes. + + * babl/babl-fish.c: (fishing_result_examine), (babl_fish): + 2007-11-10 Øyvind Kolås * docs/index-static.html.in: documented BABL_STATS environment diff --git a/babl/babl-fish.c b/babl/babl-fish.c index 509815f..f0a5ee7 100644 --- a/babl/babl-fish.c +++ b/babl/babl-fish.c @@ -73,6 +73,12 @@ fishing_result_examine (Babl *babl, (void *) data->destination == (void *) babl->fish.destination) { data->ret = babl; + /* we do not return BABL_FISH_REFERENCE's since those might exist + * even before a valid BABL_FISH_PATH has been constructed for a + * given conversion. + */ + if (data->ret->class_type == BABL_FISH_REFERENCE) + return 0; return 1; /* stop iterating */ } return 0; /* continue iterating */ @@ -137,14 +143,16 @@ babl_fish (void *source, return NULL; } - { + if(1){ Babl *lucky; lucky = go_fishing (source_format, destination_format); if (lucky) return lucky; } - if (0) + if (0) /* do not accept shortcut conversions, since there might be + a faster path + */ { Babl *shortcut_conversion; -- 2.30.2